/*
 * Project : Linuxbox
 * File    : UserManAdd.java
 * Version : 1.0
 * Author  : Kevin Zhang
 *
 * Copyright (c) 2000-2001 by Linuxbox, Inc.
 * All rights reserved.
 */
package linuxbox.admin.servlet;

import javax.servlet.http.*;

import linuxbox.BoxStatic;
import linuxbox.admin.logic.*;
import linuxbox.common.*;

public class UserGrpAddAction extends Action {
	protected static String successJSP = null;
		
    public void doAction(HttpSession aSession, BoxSession aBoxSession, 
    HttpServletRequest req, HttpServletResponse res) throws Exception {
		BoxStatic.logger.debug("I am in UserGrpAdd now ... ");
		
		String grpName = req.getParameter("GROUP_NAME");
		String desc = req.getParameter("DESC");
	
		BoxStatic.logger.debug("group name is " + grpName);
		BoxStatic.logger.debug("desc is " + desc);
		
		UserGrpObject ugo = new UserGrpObject(grpName, 0, desc);
		UserManager um = UserManager.getInstance();
		um.addUserGrp(ugo);
		
		redirectFile(successJSP, req, res);
		BoxStatic.logger.debug("I am leaving DeptManAdd now ... ");
	}

	public void setSuccessJSP(String str) {
	    //"/linuxbox/jsp/admin/DeptAdmin.jsp"
		successJSP = str;
	}
}
